package com.bestsoft.flow.service.impl;

import java.util.List;

import com.bestsoft.common.annotation.DataScope;
import com.bestsoft.common.utils.DateUtils;
import com.bestsoft.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestsoft.flow.mapper.FlowGyslxPfMapper;
import com.bestsoft.flow.domain.FlowGyslxPf;
import com.bestsoft.flow.service.IFlowGyslxPfService;

/**
 * 供应商流向(批发)Service业务层处理
 * 
 * @author 崔健
 * @date 2023-08-30
 */
@Service
public class FlowGyslxPfServiceImpl implements IFlowGyslxPfService 
{
    @Autowired
    private FlowGyslxPfMapper flowGyslxPfMapper;

    /**
     * 查询供应商流向(批发)
     * 
     * @param id 供应商流向(批发)主键
     * @return 供应商流向(批发)
     */
    @Override
    public FlowGyslxPf selectFlowGyslxPfById(Long id)
    {
        return flowGyslxPfMapper.selectFlowGyslxPfById(id);
    }

    /**
     * 查询供应商流向(批发)列表
     * 
     * @param flowGyslxPf 供应商流向(批发)
     * @return 供应商流向(批发)
     */
    @Override
    @DataScope(deptAlias = "a",userAlias = "b")
    public List<FlowGyslxPf> selectFlowGyslxPfList(FlowGyslxPf flowGyslxPf)
    {
        return flowGyslxPfMapper.selectFlowGyslxPfList(flowGyslxPf);
    }

    /**
     * 新增供应商流向(批发)
     * 
     * @param flowGyslxPf 供应商流向(批发)
     * @return 结果
     */
    @Override
    public int insertFlowGyslxPf(FlowGyslxPf flowGyslxPf)
    {
        flowGyslxPf.setCreateTime(DateUtils.getNowDate());
        return flowGyslxPfMapper.insertFlowGyslxPf(flowGyslxPf);
    }

    /**
     * 修改供应商流向(批发)
     * 
     * @param flowGyslxPf 供应商流向(批发)
     * @return 结果
     */
    @Override
    public int updateFlowGyslxPf(FlowGyslxPf flowGyslxPf)
    {
        flowGyslxPf.setUpdateTime(DateUtils.getNowDate());
        return flowGyslxPfMapper.updateFlowGyslxPf(flowGyslxPf);
    }

    /**
     * 批量删除供应商流向(批发)
     * 
     * @param ids 需要删除的供应商流向(批发)主键
     * @return 结果
     */
    @Override
    public int deleteFlowGyslxPfByIds(Long[] ids)
    {
        return flowGyslxPfMapper.deleteFlowGyslxPfByIds(ids);
    }

    /**
     * 删除供应商流向(批发)信息
     * 
     * @param id 供应商流向(批发)主键
     * @return 结果
     */
    @Override
    public int deleteFlowGyslxPfById(Long id)
    {
        return flowGyslxPfMapper.deleteFlowGyslxPfById(id);
    }
}
